package com.linln.admin.SpringBoot.repository;

import com.linln.admin.SpringBoot.domain.Team;
import com.linln.modules.system.repository.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author Airili
 * @date 2020/12/22
 */
public interface TeamRepository extends BaseRepository<Team, Long> {

    @Query(value = "SELECT * FROM t_team WHERE teacher_id = ?1",nativeQuery = true)
    List<Team> findByTeacherId(Long id);

    @Query(value = "SELECT * FROM t_team WHERE team_name = ?1",nativeQuery = true)
    Team findByTeam_name(String teamName);
}